# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=ruby-ruby-gtkhex
_gemname=ruby-gtkhex
pkgver=0.2.0
pkgrel=8
pkgdesc='An hexadecimal widget using gtk2, inspired by GHex.'
arch=('any')
url='https://rubygems.org/gems/ruby-gtkhex'
license=('LGPL3')
depends=('ruby' 'ruby-gtk2')
provides=('ruby-ruby-gtkhex')
source=("https://rubygems.org/downloads/$_gemname-$pkgver.gem")
noextract=("$_gemname-$pkgver.gem")
sha512sums=('316673eb5a8f930ae6494df9bf78fc053f823b781b40372fe24b62e77f40358cbedb4d1e38cd8a20731c92a43de77241405075932d4e33f5fc333503026b5334')

package() {
  _gemdir="$(ruby -e'puts Gem.default_dir')"

  gem install --ignore-dependencies --no-user-install --no-document \
    -i "$pkgdir/$_gemdir" -n "$pkgdir/usr/bin" "$_gemname-$pkgver.gem"

  rm -rf "$pkgdir/$_gemdir/cache/$_gemname-$pkgver.gem"
  find "$pkgdir/$_gemdir/extensions/" -name *.so -delete
  rm -rf "$pkgdir/$_gemdir/gems/$_gemname-$pkgver/"{test,examples}
}

